package ca.etsmtl.logti.log619.lab05.analyser;

import ca.etsmtl.logti.log619.lab05.SpamType;

/**
 * Interface defining the SPAM analyzers methods. Classes implementing this interface have to keep the result of each SPAM filter that is passed, and return an String that will be shown
 * to the console with the result.  
 * @author Maxime Caumartin<maxime.caumartin.1@ens.etsmtl.ca>
 */
public interface SpamAnalyser {
	
	/**
	 * The value that @ref getFalsePositives() and @ref getFalseNegatives() should return if the information is not available.
	 */
	public static final int NO_INFO = -1;
	
	/**
	 * The value from where should be considered a message SPAM.  
	 */
	public static final int SPAM_THREASHOLD = 50;
	
	/**
	 * A textual representation of the analysis that will be printed on the console, after the number of SPAM/HAM and false positives/negatives.
	 * @return The result in printable format.
	 */
	public String analyserResult();
	
	/**
	 * Returns the number of total emails analyzed
	 * @return the number of emails analyzed
	 */
	public int getTotalCount();
	
	/**
	 * Returns the number of emails that were detected as SPAM.
	 * @return the number of emails that are SPAM.
	 */
	public int getSPAMcount();
	
	/**
	 * Returns the number of emails that were detected as HAM.
	 * @return the number of emails that are HAM.
	 */
	public int getHAMcount();
	
	/**
	 * Returns the number of false positives, if available. If not, return @ref SpamAnalyser.NO_INFO.
	 * @return the number of false positives detected.
	 */
	public int getFalsePositives();
	
	/**
	 * Returns the number of false negatives, if available. If not, return @ref SpamAnalyser.NO_INFO.
	 * @return the number of false negatives detected.
	 */
	public int getFalseNegatives();

	/**
	 * Saves the data from a SPAM check.
	 * @param filterName The name of the filter that was used.
	 * @param emailIdentifer An identifier that will permit the tracking of the scanned email (e.g. the file path).
	 * @param type The type of the email, if known.
	 * @param SPAMLevel The result of the SPAM check, from -1 to 100.
	 */
	public void addResult(String filterName, String emailIdentifer, SpamType type, byte SPAMLevel);
}
